Repository navigation
ENH make spawn.get_executable return bytes on POSIX - #682
Open
Muhtasim-Munif-Fahim wants to merge 1 commit into
Open
Muhtasim-Munif-Fahim wants to merge 1 commit into
Muhtasim-Munif-Fahim wants to merge 1 commit into
Conversation
Align loky.backend.spawn with multiprocessing.spawn: store the interpreter path as bytes on POSIX and str on Windows, add a matching set_executable helper and drop the ad-hoc utf-8 encoding in resource_tracker.spawnv_passfds. Closes joblib#655
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #655
loky.backend.spawn.get_executablenow followsmultiprocessing.spawn: the interpreter path is stored asbyteson POSIX andstron Windows, through a newset_executablehelper (mirroring the stdlib one). That lets us remove the ad-hocpath.encode("utf-8")(and its TODO) fromresource_tracker.spawnv_passfds, so the path is now encoded withos.fsencodelike in the stdlib rather than forced to UTF-8.Callers on POSIX (
resource_trackerand the vendoredstdlib_py314_resource_tracker) pass the value straight toutil.spawnv_passfds, which already accepts bytes. The Windows code paths still get astr.Tests:
test_get_executable_typeandtest_set_executable_roundtripintests/test_loky_backend.pytests/test_loky_backend.py,tests/test_resource_tracker.py,tests/test_reusable_executor.pypass locally (Linux, Python 3.13)AI-assistance disclosure: I prepared this change with help from an AI coding assistant. I reviewed it and tested it locally.